import React, {Component} from "react";
import {Link} from "react-router-dom";
import {MenuConfig} from "./menuConfig";

export default class Menu extends Component {

    render() {
        //todo 请求服务端, 读取菜单
        let menus = [];
        MenuConfig.forEach((val) => {
            menus.push(<li key={val.id}><Link to={val.path}>{val.title}</Link></li>);
        })
        //渲染
        return (
            <div className={"App-Menu"}>
                <ul>
                    {menus}
                </ul>
            </div>
        );
    }
}